<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="zh-cn">
    <head>
        <!-- Bootstrap -->
        <include file="Include/css" />
        <title>修改密码</title>
        <link href="__STATICS__/css/admin_list.css" rel="stylesheet">
        <link href="__STATICS__/css/sweet-alert.css" rel="stylesheet">
        <script type="text/javascript" src="__STATICS__/js/sweet-alert.min.js"></script>

    </head>
    <body>
        <include file="Include/nav_top" />
        <div class="container clearfix" id="left_menu_wraper" >
            <include  file="Include/menu_left" />
            <div id="right-content">
                <div id="right-content-inner">
                    <ul class="breadcrumb">
                        <span>您的位置：</span>
                        <li><a href="{:U('CNEPAdmin/Index/index')}">首页</a> </li>
                        <li class="active">修改密码</li>
                    </ul>
                    <!-- Tab panes -->
                    <div classss="tab-content">
                            <div role="tabpanel" class="tab-pane active" id="home">
                                
                    <div class="row clearfix">
                            
                            <div class="col-md-12 margin10 ">
                                <div class="col-md-2 text_right form_bar">
                                    旧密码：
                                </div>
                                <div class="col-md-6">
                                    <input id="oldPassword" type="password" class="form-control"/>
                                </div>
                                <div class="col-md-1 text_warning text_left form_bar">
                                    *
                                </div>
                            </div>
                            <div class="col-md-12 margin10 ">
                                    <div class="col-md-2 text_right form_bar">
                                        密码：
                                    </div>
                                    <div class="col-md-6">
                                        <input id="password" type="password" class="form-control"/>
                                    </div>
                                    <div class="col-md-1 text_warning text_left form_bar">
                                        *
                                    </div>
                             </div>
                            <div class="col-md-12 margin10 ">
                                <div class="col-md-2 text_right form_bar">
                                    确认密码：
                                </div>
                                <div class="col-md-6">
                                    <input id="rePassword" type="password" class="form-control"/>
                                </div>
                                <div class="col-md-1 text_warning text_left form_bar">
                                    *
                                </div>
                           </div>
                            <div class="col-md-12 margin10 ">
                                <div class="col-md-2 text_right form_bar">
                                      
                                </div>
                                <div class="col-md-6">
                                    <a href="javascript:void(0);" id="save" class="btn btn-primary" >保存</a>
                                </div>
                           </div>
                        
                        

                </div>
               </div>
            </div>

            </div>
        </div>
        </div>

        <include file="Include/script" />
        <script>
            var isReload = false; // 标识弹出框关闭之后是否刷新页面
            var myDom; // 当前操作的dom对象
            
            /*菜单展开及高亮*/
            $(function () {
                $('.system').addClass('open');
                $('#system1').addClass('active');

                /*点击保存*/
                $("#save").on("click", function () {
                       reset_psw();
                });
                
                /*重置密码*/
                function reset_psw() {
                    if($.trim($('#oldPassword').val()) === '')
                    {
                        $('#oldPassword').focus();
                        swal('旧密码不能为空','','warning');
                    }else if($.trim($('#password').val()) === '')
                    {
                        $('#password').focus();
                        swal('密码不能为空','','warning');
                    }
                    else if($.trim($('#rePassword').val()) === '')
                    {
                        $('#rePassword').focus();
                        swal('请填写确认密码','','warning');
                    }
                    else if($.trim($('#password').val()) != $.trim($('#rePassword').val()) )
                    {
                        $('#rePassword').focus();
                        swal('两次密码不一致','','warning');
                    }
                    else
                    {
                        var ajaxData = {};
                        ajaxData.oldPassword = $.trim($('#oldPassword').val());
                        ajaxData.password = $.trim($('#password').val());
                        ajaxData.rePassword = $.trim($('#rePassword').val());
                        ajaxData.adminID = $(".reset_pass").closest('td').attr('data-id');

                        ajax_go(ajaxData ,"{:U('CNEPAdmin/SysAdmin/updatePsw')}",false);
                    }
                }
                
            });
            
        </script>
    </body>
</html>